package cn.com.sbell.vss.commander;

import javax.servlet.http.HttpServletRequest;

import org.springframework.context.ApplicationContext;

import cn.com.sbell.vss.ICommander;
import cn.com.sbell.vss.Response;
import cn.com.sbell.vss.VssConstants;
import cn.com.sbell.vss.Util;
import cn.com.sbell.vss.util.CSGRegister;

public class ConfigChanged implements ICommander {
	private CSGRegister csgRegister=null;
	
	public Response execute(HttpServletRequest request) {
		// TODO Auto-generated method stub
		
		
		csgRegister.destroy();
		try {
			Thread.sleep(300);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		csgRegister.init();
		
		Response response = Response.createResponse(request);
		response.setReturnCode(VssConstants.CODE_SUCCESS);
		return response;
	}

	public CSGRegister getCsgRegister() {
		return csgRegister;
	}

	public void setCsgRegister(CSGRegister csgRegister) {
		this.csgRegister = csgRegister;
	}

	
}
